import requests


class RegisterApi(object):
    def register(self, req_body):
        session = requests.session()
        session.get(url="http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=verify&type=user_reg")
        resp = session.post(url="http://hmshop-test.itheima.net/Home/User/reg.html",
                            data=req_body)
        # print(resp.json())
        return resp


if __name__ == '__main__':
    reg = RegisterApi()
    req_body = {"username": "13012565679",  "verify_code": "8888",
                "password": "123456", "password2":"123456"}
    resp = reg.register(req_body)
    print(resp.json())
